POV-Ray : Newsgroups : povray.general : Question About Macros : Re: New Question About Macros Server Time
11 Aug 2024 05:21:25 EDT (-0400)
  Re: New Question About Macros  
From: Peter Popov
Date: 15 Oct 1999 18:35:55
Message: <V6sHOJmtyVsgp96vIByaBnfkd1tO@4ax.com>
Try this:

//---------------

#macro parse (string)
  #fopen file "parsetmp.inc" write
  #write (file, result)
  #fclose file
  #include "parsetmp.inc"
#end

#include "colors.inc"
#include "stones.inc"

sphere
{
  0, 1 
  texture { parse (concat("T_Stone",str(32*rand(seed(42)),0,0))) }
}

// still needs lights and camera :)
//--------------------

On Fri, 15 Oct 1999 10:36:54 -0400, "Bill the Galactic Hero"
<the### [at] earthlinknet> wrote:

>I seem to recall from a couple of years ago that one could not concat
>together a texture name. Has this changed? or is there a way to pass part of
>a texture name to a macro?
>
>/// This doesn't work but I wish it would ///
>
>#macro Tex(Name, Index)
>sphere{0,1 texture{concat(Name, Index)}
>#end
>
>Tex(Brown, 1)
>

Peter Popov
ICQ: 15002700


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.